﻿/*******************************************************************************

    Units of Measure for C# applications

    Copyright (C) 2013 Marek Aniola

    This program is provided to you under the terms of the license
    as published at http://unitsofmeasure.codeplex.com/license


********************************************************************************/
using System.Collections.Generic;
using System.Linq;

namespace Man.UnitsOfMeasure
{
	public class QuantityCollection<T> where T : struct
	{
		private ICollection<T> m_collection;
		private Measure<T> m_unit;

		public QuantityCollection(ICollection<T> collection, Measure<T> unit)
		{
			m_collection = collection;
			m_unit = unit;
		}

		public Quantity<T> this[int i]
		{
			get { return new Quantity<T>(m_collection.ElementAt(i), m_unit); }
		}
	}
}
